home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96b.txt / 000015_icon-group-sender _Tue Oct 8 11:02:58 1996.msg < prev    next >
Internet Message Format  |  1997-01-02  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 8 Oct 1996 12:22:18 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: Tue, 8 Oct 1996 11:02:58 GMT
  4. From: seldon@eskimo.com (Will Mengarini)
  5. Message-Id: <DyyEoz.L0D@eskimo.com>
  6. Organization: Eskimo North (206) For-Ever
  7. Sender: icon-group-request@cs.arizona.edu
  8. References: <bezeau.62.844696848@jupiter.csd.unb.ca>
  9. Subject: Re: Parsing the Icon command line
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. bezeau@jupiter.csd.unb.ca (Larry Bezeau) writes:
  13.  
  14. >h:\>type v:\cmdline.icn
  15. >procedure main(C)
  16. >  every write(&output,C[1 to *C])
  17. >end
  18.  
  19. >h:\>c:\dos\command.com /c v:\cmdline.exe "A   B"  \"C   D\"
  20. >A
  21. >B
  22. >C D
  23.  
  24. That doesn't perform the test you want, since by invoking command.com
  25. with /c on your shell's command line, you're giving your shell a chance
  26. to munge the arguments *before* it passes them to command.com, which
  27. then munges them further before passing them to Icon, which then munges
  28. them further before passing them to your cmdline program.  To test
  29. command.com for real, just invoke it as a subshell (use the command
  30.   command
  31. to get into it, & the command
  32.   exit
  33. to get out).
  34.  
  35. Then try
  36.   cmdline \"A"   "B\" etc
  37. but don't ask me why it preserves the spaces in between A & B; I just
  38. found it by random hacking.  Icon is clearly making serious improvements
  39. to the args before you see them, as the batch job
  40.   Echo %1 %2 %3 %4 %5 %6 %7 %8 %9
  41. will let you see; command.com preserves the quotes.
  42.  
  43.                    Will Mengarini  <seldon@eskimo.com>
  44.  
  45. "We are beginning to perceive how free world populations move with a
  46.  ghostly sixth sense to nurture group survival.  Consider a presidential
  47.  election where the choice is between two second-rate candidates.  The
  48.  [U.S.] election of 1988 is a good example.  An objective observer is
  49.  struck by the fact that the people give the Presidency to one party and
  50.  deliver the Congress to the opposition, thereby rendering to a minimum
  51.  the damage potential of an incompetent."
  52.       --from p124 of /Let Us Prey/ by Bill Branon
  53.